Back

serac: a R package for ShortlivEd RAdionuclide Chronology of recent sediment cores

Rosalie Bruel
April 5th, 2019

Content - serac: a R package for ShortlivEd RAdionuclide Chronology of recent sediment cores - 2. Download serac - 3. Test your hypotheses - Have fun! - Source


I had to produce some age-depth model plot for my PhD thesis. My colleagues working on dating would usually use a spreadsheet, and then a paying photo editor to edit their figures. I do not have the license for either of these, so of course I turned to R. My colleague Pierre Sabatier thought it was great and that we should turn the code in something even more automatic.

The steps are documented in our manuscript, but in this blogpost I’m including a way for you to test the potential of the function (go directly to the bototm of this page).

1. Get your data ready

The input format has to follow some codes, otherwise R will display an error message.

We are sharing within the package some example data from Lake Allos (France). You can use those to follow along, or based the input format on them. The publication by Wilhelm et al (2012) is accessible here.

Lake Allos (source: Flickr)left: Lake Allos (Source: Flickr); right: Location, hydrological, geological and geomorphological characteristics of Lake Allos and its catchment (Fig. 1 in Wilhelm et al 2012)

Your dataset should follow a similar format than the one below. Only 4 columns are in fact mandatory: * top and bottom section of the sample OR average depth and thickness * 210Pbex and error on 210Pbex

With these information, you can compute a simple CRS model. Other models require to add the density.

2. Download serac

You can download serac from my GitHub repository using the packages devtools.

library(devtools)
devtools::install_github(“rosalieb/serac”)
library(serac)

3. Test your hypotheses

At the minimum, your function will be:

serac(name=“serac_example_ALO09P12”,coring_yr=2009)

Several sedimentation hypotheses were tested, and this is what the author chose as the best model:

serac(name=“ALO09P12”, coring_yr=2009, model=c(“CFCS”), plotphoto=FALSE, minphoto=c(0), maxphoto=c(210), plot_Pb=T, plot_Am=T, plot_Cs=T, Cher=c(30,40), Hemisphere=c(“NH”), NWT=c(51,61), sedchange=c(75.5), plot_Pb_inst_deposit=T, inst_deposit=c(20,28,100,107,135,142,158,186), suppdescriptor=TRUE, descriptor_lab=c(“Ca/Fe”), historic_d=c(20,28,100,107,135,142,158,186), historic_a=c(1994,1920,1886,1868), historic_n=c(“sept1 994 flood”,“1920 flood”,“1886 flood”,“1868 flood ?”), min_yr=c(1750),dmax=c(180), plotpdf=TRUE,preview=F)

Here the output plot:

Have fun!

In this tutorial, I’m using the console powered by DataCamp, so I’m just loading the script (December 2018 version). Using the GitHub version you’ll get access to the latest bug fix (whatamIsaying, everything works perfectly fine obviously).

eyJsYW5ndWFnZSI6InIiLCJzYW1wbGUiOiJteXdkIDwtIFwiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3Jvc2FsaWViL3Jvc2FsaWVicnVlbHdlYi9tYXN0ZXIvQmxvZ19hcnRpY2xlcy9cIlxucGtnVGVzdCA8LSBmdW5jdGlvbih4KVxue1xuICBpZiAoIXJlcXVpcmUoeCxjaGFyYWN0ZXIub25seSA9IFRSVUUpKVxuICB7XG4gICAgaW5zdGFsbC5wYWNrYWdlcyh4LGRlcD1UUlVFKVxuICAgIGlmKCFyZXF1aXJlKHgsY2hhcmFjdGVyLm9ubHkgPSBUUlVFKSkgc3RvcChcIlBhY2thZ2Ugbm90IGZvdW5kXCIpXG4gIH1cbn1cbiMgbm90ZSBmb3IgbGF0ZXI6IGNvcHkgYSByYXcgdmVyc2lvbiBvZiBzZXJhYyBjb2RlIGluIHRoZSB3ZWJzaXRlIHJlcG9zaXRvcnksIGFuZCBpbmNsdWRlIHRoZSBwa2dUZXN0IGZ1bmN0aW9uXG5saWJyYXJ5KGh0dHIpICMgdG8gcmVhZCBkYXRhIGZyb20gR2l0SHViXG5saWJyYXJ5KFJDdXJsKSAjIHRvIHJlYWQgc2NyaXB0IGZyb20gR2l0SHViXG5cbnNjcmlwdCA8LSBnZXRVUkwoXCJodHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vcm9zYWxpZWIvc2VyYWMvbWFzdGVyL1Ivc2VyYWMuUlwiLCBzc2wudmVyaWZ5cGVlciA9IEZBTFNFKVxuXG5ldmFsKHBhcnNlKHRleHQgPSBzY3JpcHQpKVxuXG5cbiMjIExpbmUgYmVsb3cgd2lsbCBjcmVhdGUgdGhlICdDb3JlcycgZm9sZGVyIGlmIGl0I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